﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Trap : MonoBehaviour
{
    public int Attack = 1;
    public void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag=="Player")
        {
            var damage= collision.GetComponent<IDamage>();
            damage.OnDamage(gameObject,transform.position,Attack);
        }
    }
}
